﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using MvcVietAir.Models;

namespace MvcVietAir.Controllers
{
    public class BookTicketController : Controller
    {
        private RepositoryCustomer repoCustomer = new RepositoryCustomer();
        //
        // GET: /BookTicket/

        public ActionResult Index()
        {
            return View();
        }


        public ActionResult AddInfo(InfoCustomer info)
        {
            return View(info);
        }

        [AcceptVerbs(HttpVerbs.Post)]
        public ActionResult AddInfo(InfoCustomer info, FormCollection coll)
        {
            if (ModelState.IsValid)
            {
                repoCustomer.Create(info);
                return RedirectToAction("Thanks", "BookTicket");
            }
            return View(info);
        }
        public ActionResult Thanks()
        {
            return View();
        }
    }
}
